package com.binance.notification.api.push.notification;

import com.binance.master.commons.ToString;
import com.binance.master.validator.constraints.CustomCheck;
import com.binance.notification.api.push.PushCommand;
import com.binance.notification.verifier.PushMessagePacketVerifier;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Setter;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;

import org.springframework.validation.annotation.Validated;

/**
 * 多消息数据包
 *
 * @author louis
 * @date 2018-04-09 13:55:37
 */
@ApiModel(value = "多个推送通知数据包", description = "App通知、Android通知、Ios通知、PC通知、Web通知不能全部为空！")
@CustomCheck(verifier = PushMessagePacketVerifier.class)
@Setter
public class MultipleNotificationPacket extends ToString {

    private static final long serialVersionUID = -5105787338705632586L;

    @ApiModelProperty(value = "推送控制命令", required = true)
    @NotNull
    private PushCommand command;
    @ApiModelProperty(value = "Android消息，将发送到android设备")
    private AndroidPayload androidMessage;
    @ApiModelProperty(value = "Ios消息，将发送到ios设备")
    private IosPayload iosMessage;
    @ApiModelProperty(value = "App消息，将发送到android和ios设备")
    private AppPayload appMessage;
    @ApiModelProperty(value = "Pc消息，将发送到pc端")
    private PcPayload pcMessage;
    @ApiModelProperty(value = "Web消息，将发送到Web端")
    private WebPayload webMessage;
    @ApiModelProperty(hidden = true)
    private int sendno;

    public int getSendno() {
        return this.sendno;
    }

    @Validated
    public PushCommand getCommand() {
        return command;
    }

    @Validated
    @Valid
    public AndroidPayload getAndroidMessage() {
        return androidMessage;
    }

    @Validated
    public IosPayload getIosMessage() {
        return iosMessage;
    }

    @Validated
    public AppPayload getAppMessage() {
        return appMessage;
    }

    @Validated
    public PcPayload getPcMessage() {
        return pcMessage;
    }

    @Validated
    public WebPayload getWebMessage() {
        return webMessage;
    }


}
